JavaScript

{grid.object}sort Method

Syntax

{grid.Object}.sort(column)

Arguments

column

The number of the column to sort.

Description

The sort Method sort the Grid on the specified column number.

Discussion

Equivalent to clicking on the column title to sort the Grid on that column. If the Grid is already sorted on the specified column, sorts in the opposite direction.You can optionally pass in a second argument of 'A', or 'D' to explicitly set the sort direction. You can also optionally pass in an arbitrary sort expression instead of a column number by specifying the parameter as: expression:sortExpression.

Example

Sort the Grid on column 3.

{grid.Object}.sort(3);

Sort on an explicit expression.

{grid.object}.sort('expression:LASTNAME+FIRSTNAME'); //DBF
{grid.object}.sort('expression:LASTNAME, FIRSTNAME'); //SQL

See Also